home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / src / linux-headers-2.6.28-15 / arch / mips / include / asm / bug.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-12-24  |  750 b   |  45 lines

  1. #ifndef __ASM_BUG_H
  2. #define __ASM_BUG_H
  3.  
  4. #include <asm/sgidefs.h>
  5.  
  6. #ifdef CONFIG_BUG
  7.  
  8. #include <asm/break.h>
  9.  
  10. static inline void __noreturn BUG(void)
  11. {
  12.     __asm__ __volatile__("break %0" : : "i" (BRK_BUG));
  13.     /* Fool GCC into thinking the function doesn't return. */
  14.     while (1)
  15.         ;
  16. }
  17.  
  18. #define HAVE_ARCH_BUG
  19.  
  20. #if (_MIPS_ISA > _MIPS_ISA_MIPS1)
  21.  
  22. static inline void  __BUG_ON(unsigned long condition)
  23. {
  24.     if (__builtin_constant_p(condition)) {
  25.         if (condition)
  26.             BUG();
  27.         else
  28.             return;
  29.     }
  30.     __asm__ __volatile__("tne $0, %0, %1"
  31.                  : : "r" (condition), "i" (BRK_BUG));
  32. }
  33.  
  34. #define BUG_ON(C) __BUG_ON((unsigned long)(C))
  35.  
  36. #define HAVE_ARCH_BUG_ON
  37.  
  38. #endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */
  39.  
  40. #endif
  41.  
  42. #include <asm-generic/bug.h>
  43.  
  44. #endif /* __ASM_BUG_H */
  45.